package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCrmCpxxMapper;
import com.ruoyi.system.domain.SysCrmCpxx;
import com.ruoyi.system.service.ISysCrmCpxxService;

/**
 * 产品信息Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-16
 */
@Service
public class SysCrmCpxxServiceImpl implements ISysCrmCpxxService 
{
    @Autowired
    private SysCrmCpxxMapper sysCrmCpxxMapper;

    /**
     * 查询产品信息
     * 
     * @param cpid 产品信息主键
     * @return 产品信息
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public SysCrmCpxx selectSysCrmCpxxByCpid(Long cpid)
    {
        return sysCrmCpxxMapper.selectSysCrmCpxxByCpid(cpid);
    }

    /**
     * 查询产品信息列表
     * 
     * @param sysCrmCpxx 产品信息
     * @return 产品信息
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<SysCrmCpxx> selectSysCrmCpxxList(SysCrmCpxx sysCrmCpxx)
    {
        return sysCrmCpxxMapper.selectSysCrmCpxxList(sysCrmCpxx);
    }

    /**
     * 新增产品信息
     * 
     * @param sysCrmCpxx 产品信息
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertSysCrmCpxx(SysCrmCpxx sysCrmCpxx)
    {
        return sysCrmCpxxMapper.insertSysCrmCpxx(sysCrmCpxx);
    }

    /**
     * 修改产品信息
     * 
     * @param sysCrmCpxx 产品信息
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateSysCrmCpxx(SysCrmCpxx sysCrmCpxx)
    {
        return sysCrmCpxxMapper.updateSysCrmCpxx(sysCrmCpxx);
    }

    /**
     * 批量删除产品信息
     * 
     * @param cpids 需要删除的产品信息主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysCrmCpxxByCpids(Long[] cpids)
    {
        return sysCrmCpxxMapper.deleteSysCrmCpxxByCpids(cpids);
    }

    /**
     * 删除产品信息信息
     * 
     * @param cpid 产品信息主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteSysCrmCpxxByCpid(Long cpid)
    {
        return sysCrmCpxxMapper.deleteSysCrmCpxxByCpid(cpid);
    }
}
